//路由设置
angular.module("route", ["ionic"])
    .config(function ($stateProvider, $urlRouterProvider, $ionicConfigProvider,$compileProvider) {
        //注册directive
        app.directive = $compileProvider.directive;
        $ionicConfigProvider.platform.ios.tabs.style('standard');
        $ionicConfigProvider.platform.ios.tabs.position('bottom');
        $ionicConfigProvider.platform.android.tabs.style('standard');
        $ionicConfigProvider.platform.android.tabs.position('standard');

        $ionicConfigProvider.platform.ios.navBar.alignTitle('center');
        $ionicConfigProvider.platform.android.navBar.alignTitle('center');
        //滚动条设置
        $ionicConfigProvider.scrolling.jsScrolling(false);
        //返回按钮
        $ionicConfigProvider.backButton.icon("");
        $ionicConfigProvider.backButton.text("返回");

        $stateProvider
        //微信验证
            .state("wxCheck", {
                url: "/wxCheck",
                controller: "wxCheckCtrl"
            })
            //登录
            .state("login", {
                url: "/login",
                templateUrl: "templates/login.html",
                controller: "loginCtrl"
            })
            //home
            .state("home", {
                url: "/home",
                abstract: true,
                templateUrl: "templates/home.html",
                controller: "homeCtrl"
            })
            //今日
            .state('home.today', {
                url: "/today",
                cache:false,
                views: {
                    'today-tab': {
                        templateUrl: "templates/home/today.html",
                        controller: "todayCtrl"
                    }
                }
            })
            //通知列表
            .state('home.inform-page', {
                url: "/inform-page",
                cache:false,
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/inform-page.html",
                        controller:"informPageCtrl"
                    }
                }
            })
            //阅读
            // .state('home.read-intro', {
            //     url: "/read-intro",
            //     views: {
            //         'today-tab': {
            //             templateUrl: "templates/read/read-intro.html",
            //             controller:"readIntroCtrl"
            //         }
            //     }
            // })
            //阅读
            .state('home.read-cover', {
                url: "/read-cover",
                cache:false,
                params:{
                    "queryDate":null
                },
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/read-cover.html",
                        controller:"readCoverCtrl"
                    }
                }
            })
            //目录
            .state('home.read-catalog', {
                url: "/read-catalog",
                cache:false,
                params:{
                    "queryDate":null
                },
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/read-catalog.html",
                        controller:"readCatalogCtrl"
                    }
                }
            })
            //书籍详情
            .state('home.book-info', {
                url: "/book-info",
                cache:false,
                params:{
                    "queryDate":null
                },
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/read-book-info.html",
                        controller:"bookInfoCtrl"
                    }
                }
            })
            //目录详情
            .state('home.read-catalog-list', {
                url: "/read-catalog-list",
                cache:false,
                params:{
                    "queryDate":null
                },
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/read-catalog-list.html",
                        controller:"readCatalogListCtrl"
                    }
                }
            })
            //章节
            .state('home.read-book', {
                url: "/read-book",
                cache:false,
                params:{
                    "cardNumber":null,
                    "taskDate":null
                },
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/read-book.html",
                        controller:"readBookCtrl"
                    }
                }
            })
            .state('home.read-book-punchcard', {
                url: "/read-book-punchcard",
                cache:false,
                params:{
                    "taskDate":null
                },
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/read-book-punchcard.html",
                        controller:"signCtrl"
                    }
                }
            })
            //评论
            .state('home.comment', {
                url: "/comment",
                cache:false,
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/comment.html",
                        controller:"commentCtrl"
                    }
                }
            })
            //今日笔记-添加
            .state('home.noteAdd', {
                url: "/noteAdd",
                cache:false,
                views: {
                    'today-tab': {
                        templateUrl: "templates/read/note-add.html",
                        controller:"noteAddCtrl"
                    }
                }
            })
            //教务
            .state('home.educational', {
                url: "/educational",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/home/educational.html",
                        controller:"educationalCtrl"
                    }
                }
            })
            //学习计划
            .state('home.bookList', {
                url: "/bookList",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/book-list.html",
                        controller:"bookListCtrl"
                    }
                }
            })
            //开始考试
            .state('home.examOpen', {
                url: "/examOpen",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/exam-open.html",
                        controller:"examOpenCtrl"
                    }
                }
            })
            //考试
            .state('home.examList', {
                url: "/examList",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/exam-list.html",
                        controller:"examListCtrl"
                    }
                }
            })
            //结束考试
            .state('home.examAnalysis', {
                url: "/examAnalysis",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/exam-analysis.html",
                        controller:"examAnalysisCtrl"
                    }
                }
            })
            //试卷目录
            .state('home.examCatalogue', {
                url: "/examCatalogue",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/exam-catalogue.html",
                        controller:"examCatalogueCtrl"
                    }
                }
            })
            //试题
            .state('home.examSubject', {
                url: "/examSubject",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/exam-subject.html",
                        controller:"examSubjectCtrl"
                    }
                }
            })
            //考试成绩
            .state('home.examGrade', {
                url: "/examGrade",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/exam-grade.html",
                        controller:"examGradeCtrl"
                    }
                }
            })
            //答案目录
            .state('home.examCatalogueAnswer', {
                url: "/examCatalogueAnswer",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/exam-catalogue-answer.html",
                        controller:"examCatalogueAnswerCtrl"
                    }
                }
            })
            //答案详情
            .state('home.examSubjectAnswer', {
                url: "/examSubjectAnswer",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/exam-subject-answer.html",
                        controller:"examSubjectAnswerCtrl"
                    }
                }
            })
            //学习手册
            .state('home.manual', {
                url: "/manual",
                cache:false,
                views: {
                    'educational-tab': {
                        templateUrl: "templates/educational/manual.html",
                        controller:"manualCtrl"
                    }
                }
            })
            //我的
            .state('home.my', {
                url: "/my",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/home/my.html",
                        controller:"myCtrl"
                    }
                }
            })
            //我的-头像设置
            .state('home.settingImg', {
                url: "/settingImg",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/my/setting-img.html",
                        controller:"settingImgCtrl"
                    }
                }
            })
            //个人在支部排名
            .state('home.userDeptRanking', {
                url: "/userDeptRanking",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/my/userDeptRanking.html",
                        controller:"userDeptRankingCtrl"
                    }
                }
            })
            //支部排名
            .state('home.deptRanking', {
                url: "/deptRanking",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/my/deptRanking.html",
                        controller:"deptRankingCtrl"
                    }
                }
            })
            //整体排名
            .state('home.ranking', {
                url: "/ranking",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/my/ranking.html",
                        controller:"rankingCtrl"
                    }
                }
            })
            //我的-学分查询
            .state('home.integralSearch', {
                url: "/integralSearch",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/my/integral-search.html",
                        controller:"integralSearchCtrl"
                    }
                }
            })
            //我的-成绩查询
            .state('home.gradeSearch', {
                url: "/gradeSearch",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/my/grade-search.html",
                        controller:"gradeSearchCtrl"
                    }
                }
            })
            //我的-历史书籍
            .state('home.historyBook', {
                url: "/historyBook",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/my/history-books.html",
                        controller:"historyBookCtrl"
                    }
                }
            })
            //我的笔记
            .state('home.noteList', {
                url: "/noteList",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/read/note-list.html",
                        controller:"noteListCtrl"
                    }
                }
            })
            //我的笔记-详情
            .state('home.noteContent', {
                url: "/noteContent",
                cache:false,
                params:{
                    "noteNum":null
                },
                views: {
                    'my-tab': {
                        templateUrl: "templates/read/note-content.html",
                        controller:"noteContentCtrl"
                    }
                }
            })
            //我的-设置
            .state('home.mySetting', {
                url: "/mySetting",
                cache:false,
                views: {
                    'my-tab': {
                        templateUrl: "templates/my/my-setting.html",
                        controller:"mySettingCtrl"
                    }
                }
            })
        $urlRouterProvider.otherwise("/wxCheck");
        // $urlRouterProvider.otherwise("/login");

//$urlRouterProvider.otherwise("templates/login.html");
    })
